home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 4 / Precision Software Applications Silver Collection Volume 4 (1993).iso / stats / chadyn.exe / YCOMV.C < prev    next >
Text File  |  1988-12-07  |  5KB  |  205 lines

  1. /********************************  YCOMV.C ***********************************/
  2. /***************** V=VARIOUS AND SUNDRY COMMANDS AND MENU ********************/
  3. /********************* (C) 1986,7,8 by JAMES A. YORKE ************************/
  4.  
  5.  
  6. #include "yinclud.h"
  7. #include <time.h>
  8.  
  9. int     VCommands(CodeName)
  10. register char    *CodeName;
  11. {
  12.     int     oldTaskFlag;
  13.     long    tloc;
  14.  
  15.     TEST("circle") {
  16.         oldTaskFlag = taskFlag;
  17.         taskFlag = 100;
  18.         caseT();
  19.         taskFlag = oldTaskFlag;
  20.         return(1);
  21.     }
  22.     TEST("cont") {
  23.         refreshFlag = YES;
  24.         boot = 1;
  25.         return(1);
  26.     }
  27.     TEST2("cross", "k") {    /* when cross0flag = 1, the large cross will be
  28.                    plotted at each dot, and erased before the
  29.                    next cross is drawn */
  30.         cross0flag = 1 - cross0flag;
  31.         if (SCREEN)
  32.               PRINT "Flag for printing a large cross at each dot is ");
  33.         toggle(cross0flag);
  34.         return(1);
  35.     }
  36.     TEST("db") {
  37.         boxx = 1 - boxx;
  38.         PRINT " DB:   Draw Box toggle is currently");
  39.         toggle(boxx);
  40.         return(1);
  41.     }
  42.     TEST("images") {
  43.         images = (int) Entervalue((double) images, CHECKSET);
  44.         return(1);
  45.     }
  46.     TEST2("increment", "inc") {/* increment a variable by rho_step */
  47.         erase_line();
  48.         PRINT "Enter the name of the variable to be incremented:");
  49.         if(GetCommand(CodeName) == 0)
  50.             return(1);
  51.         TEST2("c1", "1")
  52.             incrementD(&C1, CodeName);
  53.         TEST2("c2", "2")
  54.             incrementD(&C2, CodeName);
  55.         TEST2("c3", "3")
  56.             incrementD(&C3, CodeName);
  57.         TEST2("c4", "4")
  58.             incrementD(&C4, CodeName);
  59.         TEST2("c5", "5")
  60.             incrementD(&C5, CodeName);
  61.         TEST2("c6", "6")
  62.             incrementD(&C6, CodeName);
  63.         TEST2("c7", "7")
  64.             incrementD(&C7, CodeName);
  65.         TEST2("c8", "8")
  66.             incrementD(&C8, CodeName);
  67.         TEST2("c9", "9")
  68.             incrementD(&C9, CodeName);
  69.         TEST2("r", "rho")
  70.             incrementD(&rho, CodeName);
  71.  
  72.         return(1);
  73.     }
  74.     TEST2("p","pause")
  75.     {
  76.         if (cycle !=0)
  77.             cycle = 0;
  78.         else
  79.             cycle = 1;
  80.         if (SCREEN && level < PROCESS)
  81.             PRINT 
  82. " PAUSE: if on, when returning to screen, process will be paused; currently");
  83.         toggle(cycle);
  84.         return(1);
  85.     }
  86.     TEST("ph") {
  87.         onprint = (int) Entervalue((double) onprint, CHECKSET);
  88.         return(1);
  89.     }
  90.     TEST("ps") {
  91.         pprint(onprint);
  92.         beep();
  93.         return(1);
  94.     }
  95.  
  96.     TEST2("pt", "printer") {
  97.         printer = (int) Entervalue((double) printer, CHECKSET);
  98.         return(1);
  99.     }
  100.     TEST("rcircle") {
  101.         oldTaskFlag = taskFlag;
  102.         boot = 1;
  103.         taskFlag = 100;
  104.         caseT();
  105.         taskFlag = oldTaskFlag;
  106.         return(1);
  107.     }
  108.     TEST("runtime") {    /* set run time in minutes; */
  109.         setRunTime();    /* in Y.C */
  110.         return(1);
  111.     }
  112.     TEST("tic") {
  113.         if(ticFlag != 0)
  114.             ticFlag = 0;
  115.         else
  116.             ticFlag = 1;
  117.         erase_line();
  118.         PRINT
  119.             " Flag for drawing tic marks when drawing box is now ");
  120.         toggle(ticFlag);/* prints " ON\n" or " OFF\n" */
  121.         PRINT
  122.             "This is a toggle; enter this instruction again to turn it");
  123.         toggle(1 - ticFlag);/* prints " ON\n" or " OFF\n" */
  124.         PRINT
  125.             "An additional extra fine set of tic marks with 1/5 the spacing will be \n");
  126.         PRINT
  127.             "drawn if command \"TIC2\" has been called; that feature is turned off by \n");
  128.         PRINT
  129.             "entering \"TIC\". Interrupt 'T' also results in drawing this extra set. \n");
  130.         return(1);
  131.     }
  132.     TEST("tic2") {
  133.         ticFlag = 2;
  134.         erase_line();
  135.         PRINT
  136.             " Flag for drawing 2 sets of tic marks is now ON. Enter \"TIC\" to cancel.");
  137.         return(1);
  138.     }
  139.     TEST("time") {
  140.         PRINT asctime(localtime(&tloc)));
  141.         return(1);
  142.     }
  143.     return(0);
  144. }
  145.  
  146. menuV() {
  147.     if(level == SETPARAM)
  148.         scr_clr();    /* in desmets pcio.a */
  149.     scr_rowcol(0, 2);
  150.  
  151.  
  152.  
  153.     PRINT
  154.         "       VARIOUS AND SUNDRY:  OUTPUT  MENU OF PRINTING and MISCELLANY    \n\n");
  155.  
  156.     PRINT
  157.         " CIRCLE: draw CIRCLE; center=y1[]; set radius with RA, # images with 'I'\n");
  158.  
  159.     PRINT
  160.         " CONT:   next computation should CONTinue with the current value of dot  \n");
  161.  
  162.     PRINT
  163.         " DB:     (alias \"BOX\") Draw Box toggle; currently");
  164.     toggle(boxx);
  165.  
  166.     PRINT
  167.         " IMAGES: sets the number of images of y0; see interrupt 'I'\n");
  168.  
  169.     PRINT
  170.         " INC:   changes the variable to incremented by interrupts +/- ;see also RS\n"
  171.         );
  172.  
  173.  
  174.     PRINT
  175.         " K:     plots big cross at each dot if on; like interrupt 'k'; currently");
  176.     toggle(cross0flag);
  177.  
  178.     PRINT
  179.         " PAUSE: if on, when returning to screen, process will be paused; currently");
  180.     toggle(cycle);
  181.  
  182.     PRINT
  183.         " PH:    the number of times the Printer Head strikes each dot; now = %d\n"
  184.         ,onprint);
  185.  
  186.     PRINT
  187.         "               Set PH = 0 to prevent automatic print at end of plotting; \n");
  188.  
  189.     puts(
  190.             " PS: Prints core version of previous Screen            \n");
  191.  
  192.     PRINT
  193.         " PT:    (alias \"PRINTER\") amount of Printed Text. current setting = %d \n"
  194.         ,printer);
  195.     PRINT
  196.         " RUNTIME: runtime\n");
  197.  
  198.     PRINT
  199.         " TIC, TIC2:   add TIC marks whenever drawing box toggle; currently");
  200.     toggle(ticFlag);
  201.  
  202.     PRINT
  203.         " TIME:  current time of day.\n");
  204. }
  205.